// iOS文件拷贝至沙盒目录下
function copyPathToSandboxPath(copyPath, copyPathName, filePath) {
	return new Promise((resolve, reject) => {
		const iOSFileSelect = uni.requireNativePlugin('YangChuan-YCiOSFileSelect');
		// apple document-types 文件类型参数 https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html 
		// 文件类型参数
		let params = {
			"document-types": ["public.text", "public.zip", "public.data", "com.adobe.pdf",
				"com.microsoft.word.doc",
				"com.adobe.postscript", "com.microsoft.excel.xls", "com.adobe.encapsulated- postscript",
				"com.microsoft.powerpoint.ppt", "com.adobe.photoshop- image", "com.microsoft.word.rtf",
				"com.microsoft.advanced- systems-format", "com.microsoft.advanced- stream-redirector"
			],
			"isBase64": 0
		}
		iOSFileSelect.show(params, result => {
			let status = parseInt(result.status);
			// 状态200选取成功
			if (status == 200) {
				let url = result.url;
				uni.downloadFile({
					url: url,
					success: function(res) {
						if (res.statusCode == 200) {
							// filePath 可用于 uni.uploadFile 上传的路径
							let filePath = res.tempFilePath;
							resolve({
								path: filePath,
								name: res.lastName
							});
						}
					}
				});
			}
		});
	})
}
export default copyPathToSandboxPath;